from django.contrib import admin
from .models import PresentationTemplate, ProjectReport, ReportVersion


@admin.register(PresentationTemplate)
class PresentationTemplateAdmin(admin.ModelAdmin):
    list_display = ['name', 'template_type', 'created_at']
    list_filter = ['template_type', 'created_at']
    search_fields = ['name', 'description']
    ordering = ['template_type', 'name']


@admin.register(ProjectReport)
class ProjectReportAdmin(admin.ModelAdmin):
    list_display = ['title', 'user_profile', 'template', 'status', 'created_at', 'updated_at']
    list_filter = ['status', 'template__template_type', 'created_at']
    search_fields = ['title', 'user_profile__user__username']
    list_editable = ['status']
    ordering = ['-updated_at']


@admin.register(ReportVersion)
class ReportVersionAdmin(admin.ModelAdmin):
    list_display = ['report', 'version_number', 'created_at']
    list_filter = ['created_at']
    search_fields = ['report__title']
    ordering = ['report', '-version_number']
